#define _CRT_SECURE_NO_WARNINGS 
#include<stdio.h>

int main()
{
	int* pf = fopen("data.txt", "r");
	if (pf == NULL)
	{
		perror("fopen");
		return 1;
	}
	char arr[20] = { 0 };
	fgets(arr, 20, pf);
	printf("%s\n", arr);
	int* ptr = fopen("data_copy.txt", "w");
	fputs(arr, ptr);
	if (ptr == NULL)
	{
		perror("fopen");
		return 2;
	}
	fclose(pf);
	fclose(ptr);
	return 0;
}
